<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLivesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('lives', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('自增ID');

            $table->string('title', 300)->comment('直播标题');
            $table->string('url', 500)->comment('直播url');
            $table->string('cover', 500)->comment('直播封面图');
            $table->timestamp('live_time')->comment('直播时间');
            


            $table->unsignedBigInteger('publisher_uid')->comment('发布者uid')->index();

            $table->timestamps();
            $table->softDeletes();

            $table->engine = 'InnoDB';

        });
        DB::statement("alter table `lives` comment'直播表'");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('lives');
    }
}
